﻿using Lhz.Data;
using System.Collections.Generic;
using System.ServiceModel;

namespace Lhz.Common.Interface
{
    [ServiceContract]
    public interface IEntityService
    {

    }

    [ServiceContract]
    public interface IEntityService<TPk, TEntity> : IEntityService where TEntity : class, new()
    {
        [OperationContract]
        List<TEntity> Query(string[] paths);

        [OperationContract]
        List<TEntity> QueryByPagination(ref Pagination pagination, string[] paths);

        [OperationContract]
        List<TEntity> QueryByOrderBies(List<OrderBy> orderBies, string[] paths);

        [OperationContract]
        List<TEntity> QueryByPaginationAndOrderBies(ref Pagination pagination, List<OrderBy> orderBies, string[] paths);

        [OperationContract]
        TEntity QueryByPk(TPk pk, string[] paths);

        [OperationContract]
        void Add(TEntity item);

        [OperationContract]
        void Adds(IEnumerable<TEntity> items);

        [OperationContract]
        void Update(TEntity item);

        [OperationContract]
        void Updates(IEnumerable<TEntity> items);

        [OperationContract]
        void Delete(TEntity item);

        [OperationContract]
        void Deletes(IEnumerable<TEntity> items);

        [OperationContract]
        void DeleteByPk(TPk pk);

        [OperationContract]
        void DeleteByPks(IEnumerable<TPk> pks);
    }
}
